<? include("admin/function.php"); ?>

<?






$chk = Q1("select wl_id from whislist WHERE pd_id  = '".$pd_id."' and wl_ip = '".session_id()."' and wl_date = '".date("Y-m-d")."' and  wl_img='$img_id' LIMIT 1");  
if($chk[0] >= 1) 
	
{
	
	echo "x**รายการสินค้านี้มีใน whislist แล้ว "; exit;
	
	
} // hide add
else {  







$valuearray['pd_id'] = $_REQUEST['pd_id'];
$valuearray['wl_size'] = $_REQUEST['pdsize'];
$valuearray['wl_color'] = $_REQUEST['pdcolor'];
$valuearray['wl_ip'] = session_id();
$valuearray['wl_date'] = date("Y-m-d");
$maxorder = Q1("select MAX(wl_order) from whislist  ");
$valuearray['wl_order'] = $maxorder[0]+1;
$valuearray['wl_staus'] = 0;
$valuearray['wl_img'] = $_REQUEST['img_id'];
Qinsert("whislist","",$valuearray);
?>


    	<a href="#" onclick="showdiv('addwhishlist','ajax_addtowhislist.php?pd_id=<?=$_GET['pd_id']?>&img_id='+img_id);return false;"><img src="images/addtowhislistx.gif" alt="Add to cart" title="Add to cart" height="40" /></a>
<?}?>